<!DOCTYPE html>
<html lang="zh">
<head>

        <title>快速开始</title>
        <meta charset="utf-8" />


        <!-- Mobile viewport optimized: j.mp/bplateviewport -->
        <meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1">

        <link rel="stylesheet" type="text/css" href="/theme/gumby.css" />
        <link rel="stylesheet" type="text/css" href="/theme/style.css" />
        <link rel="stylesheet" type="text/css" href="/theme/pygment.css" />

        <script src="/theme/js/libs/modernizr-2.6.2.min.js"></script>




</head>

<body id="index" class="home">


    <div class="container">

        <div class="row">

          <header id="banner" class="body">
                  <h1><a href="/">abraham's blog <strong></strong></a></h1>
          </header><!-- /#banner -->

            <div id="navigation" class="navbar row">
              <a href="#" gumby-trigger="#navigation &gt; ul" class="toggle"><i class="icon-menu"></i></a>
             
              <ul class="columns">
                <li><a href="/">Home</a></li>

                <li><a href="/pages/pelican.html">Pelican</a></li>

              </ul>
            </div>

<section id="content" class="body">

   <div class="row">
        <div class="eleven columns">


            <header>
              <h2 class="entry-title">
                <a href="/pages/2015/01/25/kuai-su-kai-shi/" rel="bookmark"
                   title="Permalink to 快速开始">快速开始</a></h2>
           
            </header>
            <footer class="post-info">
              <abbr class="published" title="2015-01-25T00:00:00+08:00">
                Sun 25 January 2015
              </abbr>
              <address class="vcard author">By 
                <a class="url fn" href="/author/abraham.html"> Abraham</a>
              </address>
            </footer><!-- /.post-info -->
            <div class="entry-content">
              <p>我们推荐你通读本文档，下面是为了那些急切的人提供的快速入门教程。</p>
<h2>安装</h2>
<p>用你喜欢的终端在Python2.7.x或Python 3.3+上安装Pelican（如果需要可以安装Markdown），命令为：</p>
<div class="highlight"><pre>sudo pip install pelican markdown
</pre></div>


<h2>创建项目</h2>
<p>首先为你的项目选一个名字，在本地创建一个合适的目录，并进入该目录：</p>
<div class="highlight"><pre>mkdir -p ~/projects/yoursite
cd ~/projects/yoursite
</pre></div>


<p>通过<code>pelican-quickstart</code>命令创建一个项目框架，该命令会问你几个关于你的网站的问题：</p>
<div class="highlight"><pre>pelican-quickstart
</pre></div>


<p>对中括号中有默认值的问题，你可以按回车键接受那些默认值。在关于网站前缀的问题，输入你预想的域名(例如： http://example.com)。</p>
<h2>创建文章</h2>
<p>当创建一些内容后，你才可以运行Peliacn。用你喜欢的文本编辑器创建你的第一篇文章，内容如下：</p>
<div class="highlight"><pre><span class="n">Title</span><span class="o">:</span> <span class="n">My</span> <span class="n">First</span> <span class="n">Review</span>
<span class="n">Date</span><span class="o">:</span> <span class="mi">2015</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">24</span>
<span class="n">Category</span><span class="o">:</span> <span class="n">review</span>

<span class="n">Following</span> <span class="k">is</span> <span class="n">a</span> <span class="n">review</span> <span class="n">of</span> <span class="n">my</span> <span class="n">favorite</span> <span class="n">mechanical</span> <span class="n">keyboard</span><span class="o">.</span>
</pre></div>


<p>上面给的内容是Markdown格式的，将它保存为<code>～/projects/yoursite/content/keyboard-review.md</code></p>
<h3>生成你的站点</h3>
<p>在你的项目文件夹，运行<code>pelican</code>命令来生成你的站点：</p>
<div class="highlight"><pre>pelican content
</pre></div>


<p>你的网站内容已经在<code>output</code>文件夹内生成了。（你可能会看到一些关于feed的警告，但这在本地开发时是正常的，现在可以忽略它们。）</p>
<h3>预览你的网站</h3>
<p>新打开一个终端，进入<code>output</code>文件夹后输入下列命令来运行内建的web服务器：</p>
<div class="highlight"><pre>cd ~/projects/yoursite/output
python -m SimpleHTTPServer
</pre></div>


<p>用你的浏览器访问<code>http://localhost:8000/</code>来预览你的网站。</p>
<p>继续阅读剩余的文档来获取更多的细节，并且查看Pelican wiki's Tutorials 页面来获取社区出版的教程。</p>
            </div><!-- /.entry-content -->
            <div class="comments">
              <h3>Comments</h3>
              <div id="disqus_thread"></div>
              <script type="text/javascript">
                var disqus_identifier = "pages/2015/01/25/kuai-su-kai-shi/";
                (function() {
                var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
                dsq.src = 'http://abrahamblog.disqus.com/embed.js';
                (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
                })();
              </script>
            </div>


        </div><!-- /.eleven.columns -->

<div class="three columns">

<h4>Pages</h4>

 <ul>
      <li><a href="/pages/pelican.html">Pelican</a></li>
  </ul>

<h4>Categories</h4>
<ul>
		<li><a href="/category/pelican.html">Pelican</a></li>
</ul>


<h4>Tags</h4>
	<ul>
	    <li class="tag-1"><a href="/tag/pelican.html">pelican</a></li>
</ul>



</div> </div><!-- /.row -->


</section>

       </div><!-- /.row -->
    </div><!-- /.container -->


       <div class="container.nopad bg">

    
        <footer id="credits" class="row">
          <div class="seven columns left-center">

                   <address id="about" class="vcard body">
                    Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
                    which takes great advantage of <a href="http://python.org">Python</a>.
                    <br />
                    Based on the <a target="_blank" href="http://gumbyframework.com">Gumby Framework</a>
                    </address>
          </div>


          <div class="seven columns">
            <div class="row">
              <ul class="socbtns">





              </ul>
            </div>
          </div>
        </footer>

    </div>


<script type="text/javascript">
    var disqus_shortname = 'abrahamblog';
    (function () {
        var s = document.createElement('script'); s.async = true;
        s.type = 'text/javascript';
        s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    }());
</script>
  <script src="/theme/js/libs/jquery-1.9.1.min.js"></script>
  <script src="/theme/js/libs/gumby.min.js"></script>
  <script src="/theme/js/plugins.js"></script>
</body>
</html>